﻿

namespace Mulala.Cavan.TestAppService.InformationModule
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using NUnit.Framework;
    using Spring.Context;
    using Spring.Context.Support;
    using Mulala.Cavan.Application.MainBoundedContext.InformationModule;
    using Mulala.Cavan.Application.MainBoundedContext.MulalaModule;
    using Mulala.Cavan.Domain.MainBoundedContext.InformationModule;
    using Mulala.Cavan.Domain.Seedwork;

    [TestFixture]
    public class TestNoticeAppService
    {
        private IApplicationContext context;
        private INoticeAppService NoticeAppService { get; set; }

        [SetUp]
        public void SetUp()
        {
            context = ContextRegistry.GetContext();
            this.NoticeAppService = context.GetObject(MulalaAppServiceConst.NOTICEAPPSERVICE) as INoticeAppService;
        }

        [Test]
        public void TestAddNotice()
        {
            Notice notice = NoticeFactory.CreateNotice("第一个公共","","一个公告","", InformationIdentifier.NoticeType.Normal, 1, true, 1, DateTime.Now, DateTime.Now, "administrator");
            BoolGenericResult<Notice> result = this.NoticeAppService.Add(notice);

            Assert.Greater(result.Object.ID, 0);
        }
    }
}
